/* SPDX-License-Identifier: GPL-2.0 */

#ifndef __ACCELERATE_ECRYPTFS_H
#define __ACCELERATE_ECRYPTFS_H

#include <linux/fs.h>
#include <linux/scatterlist.h>
#include "ecryptfs_kernel.h"

#ifdef CONFIG_ONT_NET_FEATURES
typedef unsigned int (*func_ipsec_accelerate)(struct scatterlist *src,
	struct scatterlist *dst, struct ecryptfs_crypt_stat *crypt_stat,
	char *extent_iv, size_t extent_size);
void ecryptfs_accelerate_init(void);
void ecryptfs_accelerate_exit(void);
void ecryptfs_write_deley(void);
int ecryptfs_accelerate(struct scatterlist *src,
	struct scatterlist *dst, struct ecryptfs_crypt_stat *crypt_stat,
	char *extent_iv, size_t extent_size, int op);
#else
static inline void ecryptfs_accelerate_init(void) {}
static inline void ecryptfs_accelerate_exit(void) {}
static inline void ecryptfs_write_deley(void) {}
static inline int ecryptfs_accelerate(struct scatterlist *src,
	struct scatterlist *dst, struct ecryptfs_crypt_stat *crypt_stat,
	char *extent_iv, size_t extent_size, int op) { return -EINVAL; }
#endif

#endif
